package com.explorati.LeetCode001.twosum1;

/**
 * @ Author : Weijian_Wang
 * @ Date : Created in 17:52 2020/9/19 0019
 * @ Description ：
 */
public class Solution2 {
    public int[] twoSum(int[] nums, int target) {
        int[] res = new int[2];

        for(int i = 0; i < nums.length; i++) {
            for (int j = nums.length - 1; j > i; j--) {
                if(nums[i] + nums[j] == target) {
                    res[0] = i;
                    res[1] = j;
                    return res;
                }
            }
        }

        return res;
    }
}
